﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;

namespace NodeBasedSkillEditor.Model.Node.RT
{
    public class Node_ScalarToVector3_RT : RT_Node
    {
        public RT_SingleValuePort In_X;

        public RT_SingleValuePort In_Y;

        public RT_SingleValuePort In_Z;

        public RT_SingleValuePort Out_Vector3;

        public Node_ScalarToVector3_RT(Node_ScalarToVector3 sourceData, RT_DAG parentDag) : base(sourceData, parentDag)
        {
            In_X = new RT_SingleValuePort(EPortIOType.Input, sourceData.X, this);
            In_Y = new RT_SingleValuePort(EPortIOType.Input, sourceData.Y, this);
            In_Z = new RT_SingleValuePort(EPortIOType.Input, sourceData.Z, this);

            Out_Vector3 = new RT_SingleValuePort(EPortIOType.Output, sourceData.Vector3, this);
            Out_Vector3.OnGetValue = GetOutVector3;
        }

        public AValue GetOutVector3(DAG_Executor executor)
        {
            var x = In_X.GetValue(executor) as Value_Scalar;
            var y = In_Y.GetValue(executor) as Value_Scalar;
            var z = In_Z.GetValue(executor) as Value_Scalar;
            Out_Vector3.SourceValue.SetVector3(new Vector3(x.Value, y.Value, z.Value));
            return Out_Vector3.SourceValue;
        }
    }
}
